package cn.tworice.blog.aspect;

import cn.tworice.blog.utils.CoreService;
import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.stereotype.Component;

import javax.servlet.http.HttpServletRequest;
import java.util.Arrays;

/**
 * 日志打印AOP
 * @author 二饭
 * @email 1786705138@qq.com
 */
@Aspect
@Component
@Slf4j
public class LogAspect {

    @Before("execution(* cn.tworice.blog.web.DouyinController.getUrl(..))")
    public void doBefore(JoinPoint joinPoint){
        Object[] args=joinPoint.getArgs();
        for (Object a:
                args) {
            System.out.println(a.toString());
        }
    }
}
